using System;
namespace ShopfloorWeb
{

    public struct record2_Item
    {
        public string ItemName;
        public string Family;
        public string Machine;
        public string Report;
        public string Familycode;
        public string Shift;
        public string Head;
        public string Tail;
        public int UsefullTbodyNumber;
    }

    public static class Report
    {

        public static string report2(DateTime start, DateTime end, string shift, string machine, string reportName, string family, string OtherRule)
        {
            return report2(start, end, shift, machine, reportName, family) + OtherRule;
        }
        public static string report2(DateTime start, DateTime end, string shift, string machine, string reportName, string family)
        {
            string url = "";
            url = url + @"http://shopfloor.ps.it.conti.de/webgui/report2.php?sourceButton=PLOT&start_year=";
            url = url + start.Year.ToString();
            url = url + @"&start_month=";
            url = url + start.Month.ToString();
            url = url + @"&start_day=";
            url = url + start.Day.ToString();
            url = url + @"&shift=";
            url = url + shift;              //@"shift%201-3";
            url = url + @"&machine=";
            url = url + machine;            //@"CR14%20Assembly";
            url = url + @"&stop_year=";
            url = url + end.Year.ToString();
            url = url + @"&stop_month=";
            url = url + end.Month.ToString();
            url = url + @"&stop_day=";
            url = url + end.Day.ToString();
            url = url + @"&report=";
            url = url + reportName;         //@"Technology%20Report";
            url = url + @"&testplans=";
            url = url + @"All%20Test%20Plans";
            url = url + @"&testplans=";
            url = url + @"All Test Plans";
            url = url + @"&hide=&family=";
            url = url + family;  //@"FC%20Deka7";DI%20XL3%20Line2
            url = url + @"&user=&password=&directDropBox=...please%20choose...&rs=no%20auto%20refresh";
            return url;
        }

        public static string report2(DateTime start, DateTime end, string shift, string machine, string reportName, string family, string FamilyCode, string Target)
        {
            string url = report2(start, end, shift, machine, reportName, family);
            return url + "&familycode=" + FamilyCode + "&Target=" + Target;

        }

        public static string report2(DateTime start, DateTime end, string shift, string machine, string reportName, string family, string FamilyCode, string Target, string FailCode)
        {
            string url = report2(start, end, shift, machine, reportName, family, FamilyCode, Target);
            return url + "&failcode=" + FailCode;

        }
        public static string report2_WithFamilyCode(DateTime start, DateTime end, string shift, string machine, string reportName, string family, string familyCode)
        {
            string url = "";
            url = report2(start, end, shift, machine, reportName, family);

            url = url + @"&familycode=";
            url = url + familyCode;
            return url;
        }

    }

}
